package com.store.application;

import java.util.Date;

public class Order {
	int id;
	double price;
	int numberOfProducts;
	float total;
	Date date;
	boolean type;
	boolean visibility; // l'ordre a ete execute ou non ? TRUE si oui FALSE sinon
	
	/**
	 * 
	 * @return : Le prix total d'un ordre.
	 */
	public double calculerTotal(){
		return this.price * this.numberOfProducts;
	}
	

	public float getTotal() {
		return total;
	}

	public void setTotal(float total) {
		this.total = total;
	}

	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}




	public Order(float price, int numberOfProducts, Date date, boolean type,
			boolean visibility) {
		super();
		this.price = price;
		this.numberOfProducts = numberOfProducts;
		this.date = date;
		this.type = type;
		this.visibility = visibility;
	}

	public Order() {
		super();
		this.date = new Date(); // moment de la creation de l'ordre
		this.visibility = true; // afficher l'ordre
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public boolean isType() {
		return type;
	}

	public void setType(boolean type) {
		this.type = type;
	}

	public boolean isVisibility() {
		return visibility;
	}

	public void setVisibility(boolean visibility) {
		this.visibility = visibility;
	}

	public Order(int identifier, float price, int numberOfProducts) {
		super();
		this.price = price;
		this.numberOfProducts = numberOfProducts;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double d) {
		this.price = d;
	}

	public int getNumberOfProducts() {
		return numberOfProducts;
	}

	public void setNumberOfProducts(int numberOfProducts) {
		this.numberOfProducts = numberOfProducts;
	}
	
	public String getType(){
		if(this.type){
			return "Vente";
		} else {
			return "Achat";
		}
	}
	

}
